package com.lx;

import lombok.Data;

/**
 * Created by lanyxp on 2020/6/20
 */
@Data
public class MsagesException extends RuntimeException {
    public String code;

    public MsagesException(String message) {
        super(message);
        this.code = CommonResultCode.SYSTEM_ERROR.getCode();
    }

    public MsagesException(String code, String message) {
        super(message);
        this.code = code;
    }

    public MsagesException(ResultCode code) {
        super(code.getDesc());
        this.code = code.getCode();
    }

    public MsagesException(Throwable cause) {
        super(CommonResultCode.SYSTEM_ERROR.getDesc(), cause);
        this.code = CommonResultCode.SYSTEM_ERROR.getCode();
    }

    public MsagesException(String msages, Throwable cause) {
        super(msages, cause);
        this.code = CommonResultCode.SYSTEM_ERROR.getCode();
    }

    public MsagesException(String msages, String code, Throwable cause) {
        super(msages, cause);
        this.code = code;
    }
}
